<?php
/*
 * @Author: 哲学家乔布斯 <wuyangii@qq.com>
 * @Date: 2022-10-20 21:41:37
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-07 22:37:15
 * @Descripttion: 系统配置
 */

namespace app\api\controller\collection\v1_0;



class Cate extends Common
{
    protected $noNeedRight = ['test'];
    /**
     * @Author: 哲学家乔布斯 <wuyangii@qq.com>
     * @brief: 
     * @return 
     * @Descripttion: 首页默认接口
     */    
    public function index(){
        $list = (new \app\common\model\GoodsCate())->field(['id','title'])->where(['pid' => 0,'is_del' => 0])->select()->toArray();
        foreach ($list as $key => &$value) {
            $value['list'] =  (new \app\common\model\GoodsCate())->field(['id','title','pid'])->where(['pid' => $value['id']])->select()->toArray();
        }
        return self::successResult("成功",$list);
    }

    
    

}
